package com.woniu.supermarket.mapper;

import com.woniu.supermarket.entity.Stock;
import com.woniu.supermarket.entity.WarehousingDetail;
import com.woniu.supermarket.vo.WarehousingDetailVo;
import com.woniu.supermarket.vo.WarehousingVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface WarehousingDetailMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(WarehousingDetail record);

    WarehousingDetail selectByPrimaryKey(Integer id);

    List<WarehousingDetail> selectAll();

    int updateByPrimaryKey(WarehousingDetail record);
    //批量添加到入库详情
    int insertBatchWarehousingDetail(@Param("warehousingDetailVoList") List<WarehousingDetailVo> warehousingDetailVoList);
    //批量删除入库单详情
    int deleteBatchWarehousingDetail(int[] ids);
    @Select("select goods_id,quantity from s_warehousing_detail")
    List<Stock> selectGoods();

    List<WarehousingDetailVo> selectAllWarehousingDetailByWarehousingId(Integer id);

    List<WarehousingDetailVo> selectAllWarehousingDetailByWarehousingNumber(String warehousingNumber);

    @Select("select * from s_warehousing_detail where warehousing_id = #{id}")
    List<WarehousingDetail> selectAllByWarehousingId(Integer id);

    int updateBatchWarehousingDetail(@Param("warehousingDetailList")List<WarehousingDetail> warehousingDetailList);
    //
    @Delete("delete from s_warehousing_detail where warehousing_id = #{id}")
    void deleteByWarehousingId(Integer id);


    //查询入库商品id和库存


}